1. Field of the Invention
The present invention relates generally to computer animated drawings (CAD) such as architectural renderings mechanical drawings, GIS drawings etc., and in particular, to a method, apparatus, and article of manufacture for modeling/simulating a magic marker stroke in such a drawing.
2. Description of the Related Art
In the architectural, engineering, and construction (AEC) fields, computer aided design (CAD) drawings are often used to design blueprints, drawings, plans, etc. However, such CAD drawings may be complex, confusing, and fail to provide an end-user (e.g., a potential client of an architect) with a drawing or visualization of the “intent” of the architect or designer. Architectural renderings are designed to illustrate the “intent” of the designer or architect, as opposed to showing precise fidelity. In these renderings, the illustrator may want to simulate or model natural media materials and strokes—such as those made by pencils and markers. For example, a simulation of a marker may need to simulate the effects of saturated ink at certain points of the stroke. However, prior art programs fail to provide the ability to present such natural media materials or marker strokes in a vector environment. Instead, the prior art identifies where a stroke is located on a large bitmap/grid and calculates the flow of ink and the distribution of the ink depending on various variables on the bitmap grid using some type of dynamic calculation. Such problems may be better understood with a description of prior art drawing software and methodologies.
CAD programs provide high fidelity drawings that fail to provide a visualization of the intent of the user. Such CAD programs or other drawing programs may be vector-based or raster-based. It may be possible to achieve hand-drawn effects in raster-based drawing programs. For example, in a raster-based program, a bitmap stroke may be created that appears hand-drawn (e.g., using a variety of raster-based drawing/paint tools). However, it may be preferable to work in a vector-based drawing. For example, in vector-based drawing programs, a user may work with modifiable shapes that can be edited, resized, and rearranged. Nonetheless, the inherent mathematical description of vector shapes lends itself to the production of hard-edged, non-organic artwork. Thus, it has always been a challenge for digital artists to achieve natural hand-drawn effects in a vector-based drawing program.
There are a number of domains, architecture being one, where there is a need to be able to create natural-looking renderings of (inherently) geometric hard-edged drawings. In this regard, architectural renderings may take a variety of forms or styles, from hand-drawn renderings, to cartoon-like rendering, to ultra-realistic 3D rendering. In an architectural rendering, it's less important to be geometrically accurate, and more important for the drawing to be able to evoke the “spirit/goals” of the project.
While the prior art has attempted to create vector-based strokes that appear organic, the prior art has failed to provide the ability to simulate or model natural media materials such as for a magic marker. In a vector environment, achieving the look of marker strokes is challenging, because when strokes overlap, there is a higher saturation of ink in the overlap area (and, consequently a darker color). Additionally, ink bleeds from the overlap area into adjacent stroke areas. A challenge of modeling this is determining the location and nature of the overlap areas with rendering techniques that allow the strokes to be modified in near-real time.
In view of the above, marker strokes are typically simulated in a raster-based environment using a single large bitmap. However, such prior art simulations are slow due to the amount of processing that must be performed. Thus, prior art marker stroke techniques fail to achieve an easy, intuitive, fast, vector-based modifiable means for providing a hand-drawn look of a marker stroke.
Another natural media material that some systems attempt to simulate is that of water colors. However, water colors are often used in a two-dimensional environment. Further, while in a 2D environment, 3D meshes are used to render the water colors. In this regard, the faces that are used to generate water colors are flat faces wherein vertices of a stroke all have the same z-value. Nonetheless, despite the use of a single plane on which all vertices exist, a 3D mesh is still utilized to render the water colors.
Another approach in rendering images utilizes shaders. A shader is a computer program used in 3D computer graphics to determine the final surface properties of an object or image. A shader often includes arbitrarily complex descriptions of various properties such as light absorption, reflection, refraction, shadowing, etc.
Various types of shaders exist. A vertex shader is applied for each vertex and runs on a programmable vertex processor. Vertex shaders define a method to compute vector space transformations and other linearizable computations. A pixel shader is used to compute properties that, most of the time, are recognized as pixel colors. Pixel shaders are applied for each pixel and are run on a pixel processor that usually features more processing power than a vertex-oriented processor.
User-based strokes may be presented in the form of one or more faces. The faces may be rendered using a shader (e.g., a pixel shader) that works locally on each point that is rendered. In this regard, given the location of one point on a surface, the shader returns the color on that point. In addition, shading algorithms are often based on the concept of multiple passes. A shader, at its highest level, is a description of how to render an object multiple times to achieve a particular effect that is not possible with only a single rendering pass. Multiple passes can describe more complex effects than single passes since each rendering pass can be different from the other rendering passes. The results of each pass are combined in the frame buffer with the previous passes. For example, if it is desirable to render an object with two textures but the hardware only supports the ability to render one texture at a time, the object can be rendered once for each texture (i.e., a pass is performed for each texture) and the results are added together.
As described above, when attempting to simulate marker strokes (also referred to as wet strokes), the prior art utilizes a large bitmap in which neighbor information can be used to perform a dynamic simulation of the fluid on the virtual paper. However, if you have a shader that works on a surface, such neighbor examination is more difficult or impossible. In a shader, one cannot examine neighboring pixels during a single pass of the shader. Instead of rendering to the frame buffer that is presented to the user (i.e., rendering to the screen), a pass renders to an off-screen texture. In subsequent passes, the previously rendered bitmaps may be sampled/examined (e.g., given a particular UV coordinate, the value of the texture can be looked-up). However, there is no mechanism for obtaining the value of neighboring pixels in the same/current pass.
Accordingly, what is needed is a way to simulate/model a marker stroke in an object-based vector drawing program in an efficient, expeditious manner.